import request from "@/utils/request";
// import axios from 'axios'
import { apiVersion } from "@/config";

// 获取详情
export function getModelEvaluatioeDetail(data) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation/${data.id}`,
		method: "get",
		data,
	});
}
// 分页列表
export function getModelEvaluatios(data) {
	return request({
		// url: `/admin/${apiVersion}/modelEvaluation`,
		url: `/admin/${apiVersion}/modelex/valModelPage`,
		method: "get",
		data,
	});
}
// 删除
export function delModelEvaluatio(data) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation/del/${data.id}`,
		method: "delete",
		data,
	});
}
// 创建
export function addModelEvaluatio(data) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation`,
		method: "post",
		data,
	});
}
// 修改
export function putModelEvaluatio(data) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation`,
		method: "put",
		data,
	});
}

// 启动
export function startModelEvaluatio(id) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation/${id}/start`,
		method: "put",
	});
}
// 启动
export function stopModelEvaluatio(id) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation/${id}/stop`,
		method: "put",
	});
}

/**
 * 获取podname
 * @param {*} data
 */
export function getModelTestPodName(data) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation/${data.id}/podName`,
		noLoadding: true,
		method: "get",
	});
}

// 查询列表
export function getAllModelEvaluatios(data) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation/all`,
		method: "get",
		data,
	});
}

// 根据模型查询
export function getAllModelEvabyModelVersion(id) {
	return request({
		url: `/admin/${apiVersion}/modelEvaluation/byModelVersion/${id}`,
		method: "get",
	});
}
